package com.example.springbootdemo2.mapper.db1;

import com.example.springbootdemo2.pojo.db1.User;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    //获取所有数据
    List<User> selectUserList();

    //通过id获取数据
    User getUserById(int id);

    //插入数据
    int addUser(User user);

    //分页查询
    @Select("SELECT * FROM db1.user")
    Page<User> getUserList();

    int addBatchUser(User user);
}
